package com.itheima03.day15;

import java.util.concurrent.CountDownLatch;

/**
 * @author 刘全
 * @date 2021/8/9
 */
public class XiaoMing extends Thread {
    private CountDownLatch countDownLatch;

    public XiaoMing(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        //加载游戏
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(getName() + "的进度到100%了");

        //告知加载完毕
        countDownLatch.countDown();
    }
}
